package 鸡蛋的硬度;

import java.util.Scanner;

public class Main {
    static int N = 110, M = 11;
    static int[][] f = new int[N][N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int m = in.nextInt();
            for (int i = 1; i <= n; i++) {
                f[i][1] = i;
            }
            for (int i = 1; i <= m; i++) {
                f[1][i] = 1;
            }
            for (int i = 2; i <= n; i++) {
                for (int j = 2; j <= m; j++) {
                    f[i][j] = f[i][j - 1];
                    for (int k = 1; k <= i; k++) {
                        f[i][j] = Math.min(f[i][j], Math.max(f[k - 1][j - 1], f[i - k][j]) + 1);
                    }
                }
            }
            System.out.println(f[n][m]);
        }
    }
}
